1. Field of Invention
The present invention relates to a method, apparatus, and storage media for image processing.
2. Background of the Invention
A mosaic technique is known which generates a mosaic image by combining, like tiles, material images. The color of each part of the resulting mosaic image is represented by that of each material image. A vast amount of processing time and memory is required for calculating the average density of a mosaic image if the resolution of its original image or material image is high or the size of the original image is very large in generating images using a mosaic technique. Furthermore, a large amount of time is required to transform an image into a desired size during positioning.
In a network system to which a remote server for generating mosaic images is connected, if a client requests the remote server to generate a mosaic image using material images contained in the client, the client must send them to the server. The client cannot prevent a possible unauthorized use of the material images sent to the server.
Because a mosaic image is created by combining material images, the resulting mosaic image redundantly contains images contained in those material images. Thus, a large amount of storage area is required to contain the mosaic image.
In view of the problems mentioned above, it is an objective of the present invention to provide an image processing apparatus and method which allow a mosaic image to be generated at higher speed with a small amount of memory.
It is another objective of the present invention to provide an image processing apparatus and method which prevent an unauthorized use of material images even if the mosaic image generation is performed in a remote server. To achieve these objectives, the present invention uses a multilevel image as a material image that constitutes a mosaic image. A multilevel image is an image for which more than one image data having different resolutions is provided for a single image. The mosaic image is generated by dividing an original image to be presented as the mosaic image into a plurality of segments (tiles) and an appropriate material image is applied to each segment. In selecting a material image to be applied to a segment, the distance between the average density of the original image contained in the segment and the average density of each material image is determined. A material image, which has the closest distance, is then fitted into the segment. Since each material image is a multilevel image, the lowest-resolution image data of it is used to calculate the average density to select a material image.
Preferably, image data whose resolution is most suitable for the segment is fitted into the segment.
Alternately, according to the present invention, material images are provided in a server and scale-down images of the material images are distributed to a client. The client determines material images to be applied as the tiles of a mosaic image based on a characteristic quantity such as the average density of their scale-down images and communicates the determined material images and their position to the server. The server combines the material images to generate the mosaic image in accordance with the position information provided by the client and output it.
Preferably, instead of scale-down images, characteristic parameters are distributed to the client in advance which represent the characteristics of each material image. The client uses these characteristic parameters to determine the position of the material images. Material images held by the server are divided into a plurality of databases according to their type or the like. The user can generate a mosaic image with material images of a desired motif by specifying databases to be used.
Alternately, according to the present invention, an image database is provided in the server and scale-down images or characteristic parameters of images contained in the database are provided. The user inputs an image to be retrieved to the client. The client calculates a characteristic quantity of the input image and compares it with the characteristic quantity of scale-down images or a predetermined characteristic quantity to obtain a similitude. The client determines the identifier of an image whose similitude exceeds a predetermined threshold and obtains the image corresponding to the identifier from the server. This is applicable to the case where the similitude of the two images is high enough to exceed the threshold. An image whose similitude is below the predetermined threshold may be determined as a similar image if the similitude of the two images is low.
Alternately, according to the present invention, the client sends, instead of images themselves, the characteristic quantity of material images based on the characteristic quantity and an original image to the server. The server determines the position of the material images based on the characteristic quantity and returns it to the client. The client fits the material image held by the client into each tile of the original image according to the position information sent from the server to generate an image.
Alternately, according to the present invention, a plurality of partial images are combined to generate an integrated image. The image data file generated contains image data of partial images constituting the integrated image. Or, it contains link information for referencing to the image data. An increase in data amount can be prevented because the data file is configured to contain no image data. Alternately, according to the present invention, the client sends a request to the server based on the identifier of a duplicated image in a situation where the whole-image file stored on the server contains the identifier and the duplicated image file which is an entire or partial duplication of its original image file is on the client. Thus, the original image file on the server and the duplicated image file on the client can be viewed as the same file and information concerning original image file on the server can easily be retrieved.
Preferably, if the original image is updated at the time when the client requests information concerning the original image, a new duplicated image is generated from the updated original image and delivered to the client.